package com.jrx.anytxn.param.service.investor;


import com.jrx.anytxn.common.exception.TxnBizException;
import com.jrx.anytxn.common.exception.TxnException;
import com.jrx.anytxn.i18n.response.TxnPage;
import com.jrx.anytxn.param.dto.investor.HandleInvestorLimitReq;
import com.jrx.anytxn.param.dto.investor.HandleInvestorLimitRes;
import com.jrx.anytxn.param.dto.investor.PrInvestorTableReq;
import com.jrx.anytxn.param.dto.investor.PrInvestorTableRes;
import com.jrx.anytxn.param.entity.PrInvestorLimit;
import com.jrx.anytxn.param.entity.PrInvestorTable;

import java.math.BigDecimal;
import java.util.List;

/**
 * 出资方表 业务接口
 *
 * @author 黄秋平
 * @date 2020-05-11 18:12
 **/
public interface IPrInvestorTableService {

    /**
     * 根据租户ID分页查询出资方信息
     * @param pageNum
     * @param pageSize
     * @param tenantId
     * @return
     */
    TxnPage<PrInvestorTableRes> findAllPageByTenId(Integer pageNum, Integer pageSize, String tenantId) throws TxnException;


    /**
     * 添加出资方信息
     * @param prInvestorTableReq
     * @return
     * @throws TxnException
     */
    PrInvestorTableRes addInvestorTable(PrInvestorTableReq prInvestorTableReq) throws TxnException;


    /**
     * 更新出资方信息
     * @param prInvestorTableReq
     * @return
     * @throws TxnException
     */
    PrInvestorTableRes modifyInvestorTable(PrInvestorTableReq prInvestorTableReq) throws TxnException;


    /**
     * 根据租户ID和利ID删除此信息
     * @param tenantId
     * @param investorId
     * @return
     * @throws TxnException
     */
    Boolean removeByInvestorIdAndTenId(String investorId, String tenantId) throws TxnException;


    /**
     * 根据租户ID和出资方ID查寻信息
     * @param tenantId
     * @param investorId
     * @return
     * @throws TxnException
     */
    PrInvestorTableRes findByTenIdAndInvestorId(String tenantId, String investorId) throws TxnException;

    /**
     * 根据租户ID查询所有出资方id
     * @param tenantId
     * @return
     * @throws TxnException
     */
    List<PrInvestorTableRes> findAllByTenId(String tenantId) throws TxnException;

    /**
     * 根据字段查询
     * @param investorId
     * @param tenantId
     * @return
     * @throws TxnBizException
     */
    PrInvestorTable findInvestorByInvestorId(String investorId, String tenantId) throws TxnBizException;

    /**
     * 根据资金方id租户id查询资金方额度信息
     *
     * @param investorId 资金方id
     * @param tenantId 租户id
     * @return PrInvestorLimit 资金方额度信息
     * @throws TxnBizException
     * @author liuyang
     * @date 2020-6-2
     */
    List<PrInvestorLimit> findInvestorLimitByInvestorId(String investorId, String tenantId) throws TxnBizException;

    /**
     * 出资方额度使用
     *
     * @param investorLimitReq 出资方额度使用请求实体
     * @return HandleInvestorLimitRes 出资方额度使用响应实体
     * @throws TxnBizException
     * @author liuyang
     * @date 2020-6-8
     */
    HandleInvestorLimitRes handleInvestorLimit(HandleInvestorLimitReq investorLimitReq) throws TxnBizException;

}

